<?php

class Application_Model_DbTable_TituDep extends Zend_Db_Table_Abstract
{

    protected $_name = 'titudep';
    protected $_primary = array('id');    
    protected $_dependentTables = array('Application_Model_DbTable_Pagamento');

    public function getContratoNome($cpf, $nome )
    {
        $select = $this->select();
        $select->from($this, array('count(*) as amount'))->where('cpf ='.$cpf." and nome = '".$nome."'");
        $rows = $this->fetchAll($select);

        return($rows[0]->amount);
    }
   

     public function insert(array $data) {
          parent::insert($data);
          return $this->getAdapter()->lastInsertId();          
    }
    
}

